@extends('template.adminpage')
@section('content')
 
<ol class="breadcrumb">
  <li><a href="{{URL::to('/order/onprocessorder')}}">On proses order</a></li>
  <li class="active">Comment</li>
</ol>
<?php
        if($comment->order_name=='idcard'){$ordername = 'ID Card';}
        else if($comment->order_name=='packaging'){$ordername = 'Packaging';}
        else if($comment->order_name=='brochure'){$ordername = 'Brosur';}
        else if($comment->order_name=='nota'){$ordername = 'Nota';}
        else if($comment->order_name=='kaos'){$ordername = 'T-Shirt';}
        ?>
<div class="container-black">
  <label style="margin-top:10px"><u>Data order</u></label>
      <div class="row">
      <div class="col-md-6">
      <div class="row">
        <div class="col-lg-3 col-md-offset-1">
        Kode order
        </div>
        <div class="col-md-1">
          :
        </div>
        <div class="col-lg-7">
          <label>{{$comment->order_code}}</label>
        </div>
      </div>
      <br>
      <div class="row">
        <div class="col-lg-3 col-md-offset-1">
        Tanggal order
        </div>
        <div class="col-md-1">
          :
        </div>
        <div class="col-lg-7">
          <label>{{date("d-M-Y",strtotime($comment->order_date))}}</label>
        </div>
      </div>
      <br>
      <div class="row">
        <div class="col-lg-3 col-md-offset-1">
        Jenis order
        </div>
        <div class="col-md-1">
          :
        </div>
        <div class="col-lg-7">
           <label>{{$ordername}}</label>
        </div>
      </div>
      </div>

         <div class="col-md-6">
      <div class="row">
        <div class="col-lg-3 col-md-offset-1">
        Pemesan
        </div>
        <div class="col-md-1">
          :
        </div>
        <div class="col-lg-7">
          <label>{{$comment->customer_name}}</label>
        </div>
      </div>
      <br>
      <div class="row">
        <div class="col-lg-3 col-md-offset-1">
        Marketing
        </div>
        <div class="col-md-1">
          :
        </div>
        <div class="col-lg-7">
          <label></label>
        </div>
      </div>
      <br>
      <div class="row">
        <div class="col-lg-3 col-md-offset-1">
        Agen
        </div>
        <div class="col-md-1">
          :
        </div>
        <div class="col-lg-7">
           <label></label>
        </div>
      </div>
      </div>
      </div>
      <br>

  <label><u>Progress pengerjaan</u></label>
    <br>
    <form action="{{URL::to('/order/onprocessorder/comment/deletecomment/'.$comment->order_id)}}"  method="post" >
    <p><a data-toggle="modal" data-target="#add"><button class="btn btn-sm btn-dark" style="height:30px" ><span class="fa fa-plus"></span> Tambah</button></a> <button class="btn btn-sm btn-dark" type="submit" style="height:30px"><span class="fa  fa-times"></span> Hapus</button></p>
    <div class="table-responsive">
     <table class="table table-bordered table-hover">
      <thead>
        <tr>
          <th><input type="checkbox" name="checkall" id="terserah" onclick="check_all('terserah', 1)" ></input></th>
          <th>No</th>
          <th>Diposting</th>
          <th>Keterangan (Komentar)</th>
          <th>Aksi</th>
        </tr>
      </thead>
      <tbody>
      <?php $no=1; ?>
      @foreach($comments as $cmt)
           <td><input type="checkbox" name="{{$cmt->order_comment_id}}" value="1" id="terserah_{{$no}}" ></input></td>
          <td>{{$no}}</td>
          <td>Pada {{date("d-M-Y",strtotime($cmt->order_comment_date))}} Oleh {{$cmt->username}}</td>
          <td>{{substr($cmt->order_comment_desc,0,45)}}...</td>
          <td style="width:100px"><a data-toggle="modal" data-target="#detail{{$cmt->order_comment_id}}" ><button class="btn btn-xs btn-dark"><span class="fa fa-file-text-o"></span> Detail</button></a></td>
      </tbody>
      <?php $no++; ?>
      @endforeach
    </table>
  </form>
  </div>
              <div class="modal fade" id="add" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 
                    <h4 align="center" class="modal-title"> <label style="">Tambah status pengerjaan </label></h4>
                    </div>
                    <div align="left">
                                 {{Form::open(array(
                                    'url' => '/order/onprocessorder/comment/addcomment/'.$comment->order_id,
                                    'method' => 'POST'
                                  ))}}
                              <div class="row" style="margin-top:10px">
                              <div class="col-md-10 col-md-offset-1">
                                  <br>
                                  <label>Isi komentar</label>
                                  <br>
                                  <textarea  class="form-control" style="width:500px;height:300px" name="comment" value="" required /></textarea>
                                 
                                
                              </div> 
                              </div>   
                    
                    </div>
                    <div class="modal-footer">

                    <button type="submit" class="btn btn-sm btn-dark"><span class="fa fa-floppy-o"></span> Simpan</button>{{Form::close()}} <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
                         
                    </div>
                  </div>
                </div>
              </div>

            @foreach($comments as $cmt)
               <div class="modal fade" id="detail{{$cmt->order_comment_id}}" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 
                    <h4 align="center" class="modal-title"> <label style="margin-top:5px; margin-bottom:25px">Set order </label></h4>
                    </div>
                    <div align="left">
                                 
                              <div class="row" style="margin-top:10px">
                              <div class="col-md-10 col-md-offset-1">

                                  <br>
                                  <label>Isi komentar</label>
                                  <br>
                                  <textarea  class="form-control" style="width:500px;height:300px" value=""  disabled />{{$cmt->order_comment_desc}}</textarea>
                                 
                                
                              </div> 
                              </div>   
                    
                    </div>
                    <div class="modal-footer">

                    <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
                         
                    </div>
                  </div>
                </div>
              </div>
              @endforeach
</div>


@stop
@stop